package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.LessonresourceUserBuyMapper;
import com.education.wisdom.pojo.LessonresourceUserBuy;
import com.education.wisdom.service.LessonresourceUserBuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 备课资源购买表 服务层实现
 *
 * @author d
 * @date 2020-07-13 16:20:28
 */
@Service
public class LessonresourceUserBuyServiceImpl implements LessonresourceUserBuyService {

    @Autowired
    private LessonresourceUserBuyMapper lessonresourceUserBuyMapper;

    //查询备课资源购买表信息
    @Override
    public LessonresourceUserBuy selectLessonresourceUserBuyById(Integer id) {
        return lessonresourceUserBuyMapper.selectLessonresourceUserBuyById(id);
    }

    // 查询备课资源购买表列表
    @Override
    public List<LessonresourceUserBuy> selectLessonresourceUserBuyList(LessonresourceUserBuy lessonresourceUserBuy) {
        return lessonresourceUserBuyMapper.selectLessonresourceUserBuyList(lessonresourceUserBuy);
    }

    /**
     *  查询用户已购买的备课共享资源
     */
    @Override
    public List<Integer> selectLessonresourceUserBuyListOther(Integer userId) {
        return lessonresourceUserBuyMapper.selectLessonresourceUserBuyListOther(userId);
    }

    @Override
    public List<LessonresourceUserBuy> selectList(LessonresourceUserBuy lessonresourceUserBuy) {
        return lessonresourceUserBuyMapper.selectList(lessonresourceUserBuy);
    }

    // 新增备课资源购买表
    @Override
    public int insertLessonresourceUserBuy(LessonresourceUserBuy lessonresourceUserBuy) {
        return lessonresourceUserBuyMapper.insertLessonresourceUserBuy(lessonresourceUserBuy);
    }

    //修改备课资源购买表
    @Override
    public int updateLessonresourceUserBuy(LessonresourceUserBuy lessonresourceUserBuy) {
        return lessonresourceUserBuyMapper.updateLessonresourceUserBuy(lessonresourceUserBuy);
    }

    //删除备课资源购买表对象
    @Override
    public int deleteLessonresourceUserBuyByIds(String ids) {
        return lessonresourceUserBuyMapper.deleteLessonresourceUserBuyByIds(Convert.toStrArray(ids));
    }
}